﻿using UnityEngine;
using System.Collections;
using System;
using GJXQGame;
public class ConfigManager
{
    public const string RootPathResourcesConfig = "Cache/Config/";

    private static ConfigManager m_cInstance;
    public static ConfigManager GetInstance()
    {
        if (m_cInstance == null)
            m_cInstance = new ConfigManager();

        return m_cInstance;
    }

    public string GetResString(string key)
    {
        string value = key;
        ChineseBase chBase = TableManager.GetInstance().GetChineseTable().Find(key);
        if (chBase != null)
            value = chBase.Text;

        return value;
    }

    // TODO: HARD CODE
    public static string[] NumToChinese = new string[] { "", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十" };

    public static string String(string key)
    { return GetInstance().GetResString(key); }

    public static string String(string key, params object[] args)
    { return string.Format(String(key), args); }
}
